XN.DataBox = FWK.Class.extend({
	$init:function(_url,_method,_obj){
		this.url = _url;
		this.method = (String(_method).toUpperCase()=="POST")?"POST":"GET";
		this.obj = FWK.isObj(_obj)?_obj:{};
	},
	askForData:function(_obj){
		var obj = this.obj;
		if(FWK.isObj(_obj)){
			FWK.extend(obj,_obj);
		}
		try{this.$loading();}catch(e){};
		FWK.Util.AjaxList.open(this.url,this.method,this.obj,this.backData.bind(this));
		delete obj;
	},
	backData:function(_xml){
		var ret = _xml?XN.checkResponse(_xml):{code:-1,des:"获取数据失败，请检查路径"};
		if(ret==true){
			this.record = _xml;
			this.$completeData();
		}
		else{
			if(this["$" + ret.code]){
				this["$" + ret.code](ret);
			}
			else{
				this.$errData(ret);
			}
		}
		ret = null;delete ret;
		_xml = null;delete _xml;
	},
	$errData:function(_ret){
		alert(_ret.des);
	},
	$1402:XN.Entry?XN.Entry.logoutComplete:null,
	$completeData:function(){
		this.$errData("数据载入成功");
	}
});